package jnpf.generater.util.common;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class SuperQueryUtil {

	public static void CreateJsFile(String data,String path,String jsFileType) throws IOException {
		String content = "const "+jsFileType+" = " + data;

		File jsFile = new File(path);
		Writer writer = null;
		try {
			writer = new FileWriter(jsFile);
			writer.write(content);
			writer.write(System.getProperty("line.separator"));
			writer.write("export default "+jsFileType);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (writer!=null){
				writer.close();
			}
		}

	}


}
